﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WHC.Hotel.Entity;
using WHC.Hotel.BLL;
using WHC.Pager.Entity;
using WHC.OrderWater.Commons;

namespace WHC.Hotel.UI
{
    public partial class FrmSelectRoom : BaseForm
    {
        public FrmSelectRoom()
        {
            InitializeComponent();
        }

        private void btnSearch_Click(object sender, EventArgs e)
        {

            if (txtRoomNo.Text.Trim() == "")
            {

                MessageUtil.ShowTips("请输入房间号");
                return;
            
            }


            RoomInfo  roomInfo= BLLFactory<Room>.Instance.FindByRoomNo(txtRoomNo.Text);
            if (roomInfo != null)
            {

                if (roomInfo.Status == RoomStatus.钟点房 || roomInfo.Status == RoomStatus.住净房 || roomInfo.Status == RoomStatus.住脏房)
                {
                    FrmAddConsume dlg = new FrmAddConsume();
                    dlg.RoomInfo = roomInfo;
                    dlg.ShowDialog();
                    this.Close();

                }
                else
                {

                    MessageUtil.ShowTips("房间号输入有误！");
                    return;

                }

            }
            else
            {
                
                MessageUtil.ShowTips("房间号输入有误！");
                return;

            
            
            }
               



        }

        private void btnCanel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
